<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Welcome to <%= title %></title>

    <!-- Bootstrap Core CSS -->
    <link href="/stylesheets/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="/stylesheets/metisMenu.min.css" rel="stylesheet">
    
    <!-- DataTables CSS -->
    <link href="/stylesheets/dataTables.bootstrap.css" rel="stylesheet">

    <!-- DataTables Responsive CSS -->
    <link href="/stylesheets/dataTables.responsive.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="/stylesheets/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="/stylesheets/font-awesome.min.css" rel="stylesheet" type="text/css">

    <link rel="stylesheet" href="/stylesheets/style.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">

            <%- include('public_header') -%>
            <%- include('public_sidebar') -%>
        </nav>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">文章管理</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="dataTable_wrapper">
                        <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>分类</th>
                                    <th>标题</th>
                                    <th>作者</th>
                                    <th>发布日期</th>
                                    <th>阅读</th>
                                    <th>评论</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <% artices.forEach(function(artice){ %>
                                    <tr>
                                        <td><%= artice._id %></td>
                                        <td><%= artice.cat_id %></td>
                                        <td><%= artice.title %></td>
                                        <td><%= artice.author %></td>
                                        <td><%= artice.post_time %></td>
                                        <td><%= artice.read_count %></td>
                                        <td><%= artice.comment_count %></td>
                                        <td><%= artice.status %></td>
                                        <td><a href="/admin/article/update/<%= artice._id %>">修改</a>| <a href="/admin/article/delete/<%= artice._id %>">删除</a></td>
                                    </tr>
                                <% }) %>
                            </tbody>
                        </table>
                    </div>
                    <!-- /.table-responsive -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="/javascripts/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="/javascripts/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="/javascripts/metisMenu.min.js"></script>

    <!-- DataTables JavaScript -->
    <script src="/javascripts/jquery.dataTables.min.js"></script>
    <script src="/javascripts/dataTables.bootstrap.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="/javascripts/sb-admin-2.js"></script>
    
    <!-- Page-Level Demo Scripts - Tables - Use for reference -->
    <script>
    $(document).ready(function() {
        $('#dataTables-example').DataTable({
                responsive: true
        });
    });
    </script>


</body>

</html>
